/*
 * Copyright (c) 2011 Jean-Marc Perronne
 * Ensisa, 12 rue des Freres Lumieres, F-68093 Mulhouse cedex
 * All rights reserved.
 *
 * The copyright of this software is owned by Werner Randelshofer. 
 * You may not use, copy or modify this software, except in  
 * accordance with the license agreement you entered into with  
 * Jean-Marc Perronne. For details see accompanying license terms. 
 */

package fr.uha.ensisa.jmp.drone.at_commands;

import fr.uha.ensisa.jmp.drone.at_commands.AtZapCommand.ZapVideoChannel;




public class AtCommands
{
	public final static AtCommand TAKE_OFF = makeTakeOff();
	public final static AtCommand LAND = makeLand();
	public final static AtCommand COM_WDG_CDE = new AtComWdgCommand();
	public final static AtCommand LEAVE_BOOTSTRAP_MODE_CDE = makeLeaveBootStrapMode();
	public final static AtCommand ACK_CONTROL_MODE_CDE = makeAckControlModeCommand();
	public final static AtCommand F_TRIM = new AtFtrimCommand();
	public final static AtCommand INDOOR_ALTITUDE_CONTOL = makeInDoorALtitudeControlCommand();
	public static final AtCommand GET_CONFIGURATION = makeGetConfigurationCommand();
	public static final AtCommand ZAP_CHANNEL_NEXT = new AtZapCommand(ZapVideoChannel.ZAP_CHANNEL_NEXT);
	public static final AtCommand ZAP_CHANNEL_HORI = new AtZapCommand(ZapVideoChannel.ZAP_CHANNEL_HORI);
	public static final AtCommand ZAP_CHANNEL_VERT = new AtZapCommand(ZapVideoChannel.ZAP_CHANNEL_VERT);
	public static final AtCommand ZAP_CHANNEL_LARGE_HORI_SMALL_VERT = new AtZapCommand(ZapVideoChannel.ZAP_CHANNEL_LARGE_HORI_SMALL_VERT);
	public static final AtCommand ZAP_CHANNEL_LARGE_VERT_SMALL_HORI = new AtZapCommand(ZapVideoChannel.ZAP_CHANNEL_LARGE_VERT_SMALL_HORI);

	private static AtCommand  makeTakeOff()
	{
		AtRefCommand tmp =  new AtRefCommand();
		tmp.param(290718208);
		return new AtCommandDelegate<AtRefCommand>(tmp);
	}

	private static AtCommand  makeLand()
	{
		AtRefCommand tmp =  new AtRefCommand();
		tmp.param(290717696);
		return new AtCommandDelegate<AtRefCommand>(tmp);
	}

	private static AtCommand  makeLeaveBootStrapMode()
	{
		AtConfigCommand tmp =  new AtConfigCommand();
		tmp.param("general:navdata_demo", "TRUE");
		return new AtCommandDelegate<AtConfigCommand>(tmp);
	}
	
	private static AtCommand makeAckControlModeCommand()
	{
		AtCtlCommand tmp =  new AtCtlCommand();
		tmp.param(AtCtlCommand.ACK_CONTROL_MODE, 0); //5
		return new AtCommandDelegate<AtCtlCommand>(tmp);
	}
	
	private static AtCommand makeInDoorALtitudeControlCommand()
	{
		AtConfigCommand tmp =  new AtConfigCommand();
		tmp.param("control:altitude_max", "2000");
		return new AtCommandDelegate<AtConfigCommand>(tmp);
	}
	
	private static AtCommand  makeGetConfigurationCommand()
	{
		AtCtlCommand tmp =  new AtCtlCommand();
		tmp.param(AtCtlCommand.CFG_GET_CONTROL_MODE, 0); //4
		return new AtCommandDelegate<AtCtlCommand>(tmp);
	}
}
